package com.qyhl.webtv.module_news.news.union.town.meetingroom;


import com.qyhl.webtv.commonlib.entity.news.MeetingRoomListBean;

import java.util.List;

/**
 * Created by qyhl on 2018/3/1.
 */

public class MeetingRoomPresenter implements MeetingRoomContract.MeetingRoomPresenter {
    private MeetingRoomModel mModel;

    private MeetingRoomActivity mView;

    public MeetingRoomPresenter(MeetingRoomActivity mView) {
        this.mView = mView;
        this.mModel = new MeetingRoomModel(this);
    }

    @Override
    public void getMeetingList(String streetId, String meetingId) {
        mModel.getMeetingList(streetId, meetingId);
    }

    @Override
    public void getListSuccess(List<MeetingRoomListBean> beanList, boolean isMore) {
        mView.getListSuccess(beanList, isMore);
    }

    @Override
    public void getListError(int code, String msg) {
        switch (code) {
            case 0:
                mView.setNoNetwork(msg);
                break;
            case 1:
                mView.showMessage(msg);
                break;
            case 2:
                mView.setError(msg);
                break;
            case 3:
                mView.setLog(msg);
                break;
            case 4:
                mView.showMessage(msg);
                break;
            default:
                break;
        }
    }
}
